package com.jay.math.clazz;

import java.math.BigInteger;
import java.util.Random;

public class BigIntegerCls {
	public static void main(String[] args) {
		BigInteger bi1 = new BigInteger("28000");
		BigInteger bi2 = new BigInteger(28, 2, new Random());

		System.out.println("bi1: " + bi1);
		System.out.println("bi2: " + bi2);
		System.out.println("-----------------------");
		System.out.println("bitCount: " + bi2.bitCount());
		System.out.println("bitLength: " + bi2.bitLength());
		System.out.println("byteValue: " + bi2.byteValue());
		System.out.println("compareTo: " + bi2.compareTo(bi1));
		System.out.println("doubleValue: " + bi2.doubleValue());
		System.out.println("floatValue: " + bi2.floatValue());
		System.out.println("-----------------------");
		System.out.println("getLowestSetBit: " + bi2.getLowestSetBit());
		System.out.println("intValue: " + bi2.intValue());
		System.out.println("longValue: " + bi2.longValue());
		System.out.println("shortValue: " + bi2.shortValue());
		System.out.println("signum: " + bi2.signum());
		System.out.println("abs: " + bi2.abs());
		System.out.println("add: " + bi2.add(bi1));
		System.out.println("and: " + bi2.and(bi1));
		System.out.println("-----------------------");
		System.out.println("andNot: " + bi2.andNot(bi1));
		System.out.println("clearBit: " + bi2.clearBit(2));
		System.out.println("divide: " + bi2.divide(bi1));
		System.out.println("flipBit: " + bi2.flipBit(1));
		System.out.println("gcd: " + bi2.gcd(bi1));
		System.out.println("isProbablePrime: " + bi2.isProbablePrime(2));
		System.out.println("setBit: " + bi2.setBit(2));
		System.out.println("testBit: " + bi2.testBit(2));
		System.out.println("toByteArray: " + bi2.toByteArray());
		System.out.println("-----------------------");
		System.out.println("valueOf: " + BigInteger.valueOf(121));
	}
}
